<!DOCTYPE html>
<html lang="en" ng-app="app">
<head>
    <meta charset="UTF-8">
    <title></title>
    <style>
        span{
            color: red;
        }
    </style>
    <script src="../jsLib/angular-1.3.0.js"></script>
</head>
<body>
<div class="" ng-controller="control">
    <div ng-click="click()"></div>
  <p> $provide factory创建服务：<span> {{aa}}</span></p>
  <p> $provide service创建服务：<span>{{bb}}</span> </p>
  <p>  factory创建服务： <span>{{cc}}</span></p>
  <p>  service创建服务： <span>{{dd}}</span></p>
</div>
<script>
    var app = angular.module('app', [], function($provide) {
        $provide.factory('factoryPro', function() {
            var data = {name:'factory of $provide',value:'vvvvvvv'};
            return data;
        });
        $provide.service('servicePro', function() {
           /* var data = {name:'service of $provide',value:'hello '};
            return data;*/
            this.name='service of $provide11111';
        });
    });
    app.factory('factory', function () {
        return{
            name:'factory'
        }
    })
    app.service('service',function(){
        /* var data = {name:'service of $provide',value:'hello '};
         return data;*/
        this.name='service'
    })
    app.controller('control',function($scope,factoryPro,servicePro,factory,service){
        $scope.aa=factoryPro.name;
        $scope.bb=servicePro.name;
        $scope.cc=factory.name;
        $scope.dd=service.name;
    })
</script>
</body>
</html>